# 获取cookie
import requests

cookie_test = requests.get('http://127.0.0.1:8000/auth', params={'username': 'admin', 'password': '123456'}).cookies

# 设置cookie
r = requests.post('http://127.0.0.1:8000/upload/', files={'file': open('./douban.txt', 'rb')}, cookies=cookie_test)
r.raise_for_status()
print(r.text)
